package cn.net.cfss.fgbp.api.console.constant;

import cn.net.cfss.fgbp.base.constant.BaseEnum;

import java.util.HashMap;
import java.util.Map;

/**
 * 证件类型枚举
 *
 * @author yudeng
 * @since 2019-04-03
 */
public enum CertificateTypeEnum implements BaseEnum<CertificateTypeEnum, Integer> {

    RESIDENT_IDENTITY_CARD(0, "居民身份证"),
    ;

    private Integer value;
    private String displayName;

    CertificateTypeEnum(Integer value, String displayName) {
        this.value = value;
        this.displayName = displayName;
    }

    @Override
    public Integer getValue() {
        return value;
    }

    @Override
    public String getDisplayName() {
        return displayName;
    }

    private static Map<Integer, CertificateTypeEnum> enumMap = new HashMap<Integer, CertificateTypeEnum>();

    static {
        for (CertificateTypeEnum en : CertificateTypeEnum.values()) {
            enumMap.put(en.getValue(), en);
        }
    }

    public static CertificateTypeEnum getEnum(Integer value) {
        return enumMap.get(value);
    }
}